*&---------------------------------------------------------------------*
*& 包含               ZFIU026_TOP
*&---------------------------------------------------------------------*
TABLES: ZFIT078_HEAD, ZFIT078_HIS.

TYPES:
  BEGIN OF TY_HISTORY,
    ZFPHM          TYPE ZFIT078_HIS-ZFPHM,
    ZFPZT          TYPE ZFIT078_HIS-ZFPZT,
    ZFPZT_TXT      TYPE TEXT30,
    ZNONO_RZZT     TYPE ZFIT078_HIS-ZNONO_RZZT,
    ZNONO_RZZT_TXT TYPE TEXT50,
    ZNONO_BXZT     TYPE ZFIT078_HIS-ZNONO_BXZT,
    ZNONO_BXZT_TXT TYPE TEXT50,
    ZNONO_GXZT     TYPE ZFIT078_HIS-ZNONO_GXZT,
    ZNONO_GXZT_TXT TYPE TEXT50,
    JSDDH          TYPE ZFIT078_HIS-JSDDH,
    DOCID          TYPE ZFIT078_HIS-DOCID,
    BUKRS          TYPE ZFIT078_HEAD-BUKRS,
    BELNR          TYPE ZFIT078_HIS-BELNR,
    GJAHR          TYPE ZFIT078_HIS-GJAHR,
    MSGTY          TYPE ZFIT078_HIS-MSGTY,
    MSG            TYPE ZFIT078_HIS-MSG,
    CHNAM          TYPE ZFIT078_HIS-CHNAM,
    CHDAT          TYPE ZFIT078_HIS-CHDAT,
    CHTIM          TYPE ZFIT078_HIS-CHTIM,
  END OF TY_HISTORY,

  BEGIN OF TY_RESULT,
    ZFPHM          TYPE ZFIT078_HEAD-ZFPHM,
    ZKPSJ          TYPE ZFIT078_HEAD-ZKPSJ,
    ZFPLX          TYPE TEXT30,            "发票类型 国内、国外
    ZFPZT          TYPE ZFIT078_HIS-ZFPZT, "发票处理状态
    ZFPZT_TXT      TYPE TEXT30,
    ZNONO_RZZT     TYPE ZFIT078_HIS-ZNONO_RZZT,
    ZNONO_RZZT_TXT TYPE TEXT50,
    ZNONO_BXZT     TYPE ZFIT078_HIS-ZNONO_BXZT,
    ZNONO_BXZT_TXT TYPE TEXT50,
    ZNONO_GXZT     TYPE ZFIT078_HIS-ZNONO_GXZT,
    ZNONO_GXZT_TXT TYPE TEXT50,
    JSDDH          TYPE ZFIT078_HIS-JSDDH,
    DOCID          TYPE ZFIT078_HIS-DOCID,
    BELNR          TYPE ZFIT078_HIS-BELNR,
    GJAHR          TYPE ZFIT078_HIS-GJAHR,
    BUDAT          TYPE BKPF-BUDAT,
    MSGTY          TYPE ZFIT078_HIS-MSGTY,
    MSG            TYPE ZFIT078_HIS-MSG,

    BUKRS          TYPE ZFIT078_HEAD-BUKRS,
    ZGFMC          TYPE ZFIT078_HEAD-ZGFMC,
    ZGFSH          TYPE ZFIT078_HEAD-ZGFSH,
    LIFNR          TYPE ZFIT078_HEAD-LIFNR,
    ZXFMC          TYPE ZFIT078_HEAD-ZXFMC,
    ZXFSH          TYPE ZFIT078_HEAD-ZXFSH,
    ZXFZH          TYPE ZFIT078_HEAD-ZXFZH,
    ZBHSJE         TYPE ZFIT078_HEAD-ZBHSJE,
    ZHSJE          TYPE ZFIT078_HEAD-ZHSJE,
    ZHJSE          TYPE ZFIT078_HEAD-ZHJSE,
    WAERS          TYPE ZFIT078_HEAD-WAERS,
    ZFPLS          TYPE ZFIT078_HEAD-ZFPLS,
    ZKPBZ          TYPE ZFIT078_HEAD-ZKPBZ,
    INVOICE_LINE   TYPE ZFIT078_HEAD-INVOICE_LINE,
    INVOICE_STATUS TYPE ZFIT078_HEAD-INVOICE_STATUS,
    INVOICE_TYPE   TYPE ZFIT078_HEAD-INVOICE_TYPE,
    PDF_URL        TYPE ZFIT078_HEAD-PDF_URL,
    XML_URL        TYPE ZFIT078_HEAD-XML_URL,

*    CRNAM          TYPE ZFIT078_HEAD-CRNAM,
*    CRDAT          TYPE ZFIT078_HEAD-CRDAT,
*    CRTIM          TYPE ZFIT078_HEAD-CRTIM,
    CHNAM_HIS      TYPE ZFIT078_HIS-CHNAM,
    CHDAT_HIS      TYPE ZFIT078_HIS-CHDAT,
    CHTIM_HIS      TYPE ZFIT078_HIS-CHTIM,
  END OF TY_RESULT.

DATA:
  GR_TABLE     TYPE REF TO CL_SALV_TABLE,
  GR_TABLE_HIS TYPE REF TO CL_SALV_TABLE,
  GT_HISTORY   TYPE TABLE OF TY_HISTORY WITH HEADER LINE,
  GT_RESULT    TYPE TABLE OF TY_RESULT WITH HEADER LINE.

SELECTION-SCREEN: BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-T01.
  SELECT-OPTIONS:
    S_BUKRS FOR ZFIT078_HEAD-BUKRS OBLIGATORY NO INTERVALS NO-EXTENSION DEFAULT 'CN10',
    S_LIFNR FOR ZFIT078_HEAD-LIFNR,
    S_ZFPHM FOR ZFIT078_HEAD-ZFPHM,
    S_ZKPSJ FOR ZFIT078_HEAD-ZKPSJ,
    S_ZXFMC FOR ZFIT078_HEAD-ZXFMC,

    S_JSDDH FOR ZFIT078_HIS-JSDDH,
    S_DOCID FOR ZFIT078_HIS-DOCID,

    S_BUDAT FOR SY-DATUM,

    S_ZFPZT FOR ZFIT078_HIS-ZFPZT,
    S_ZRZZT FOR ZFIT078_HIS-ZNONO_RZZT,
    S_ZBXZT FOR ZFIT078_HIS-ZNONO_BXZT,
    S_ZGXZT FOR ZFIT078_HIS-ZNONO_GXZT.

  PARAMETERS:
    P_GNINV AS CHECKBOX DEFAULT 'X',
    P_GWINV AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN: END OF BLOCK BLK1.
